// 引用项目中全部的全局组件
import SvgIcon from '@/components/SvgIcon/index.vue'
import Pagination from '@/components/Pagination/index.vue'
import Category from '@/components/Category/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const allGloableComponents: any = { SvgIcon, Pagination, Category }
// console.info(allGloableComponents);

// 对外暴露插件对象
export default {
  // 插件名称
  name: 'vue-plugin',

  // 插件安装
  install(app: any) {
    Object.keys(allGloableComponents).forEach((key) => {
      app.component(key, allGloableComponents[key])
    })

    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
